// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod contact_center_insights {
    use crate::Result;

    /// A builder for [ContactCenterInsights][crate::client::ContactCenterInsights].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_contactcenterinsights_v1::*;
    /// # use builder::contact_center_insights::ClientBuilder;
    /// # use client::ContactCenterInsights;
    /// let builder : ClientBuilder = ContactCenterInsights::builder();
    /// let client = builder
    ///     .with_endpoint("https://contactcenterinsights.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::ContactCenterInsights;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = ContactCenterInsights;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::ContactCenterInsights] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [ContactCenterInsights::create_conversation][crate::client::ContactCenterInsights::create_conversation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreateConversation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateConversation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateConversation(RequestBuilder<crate::model::CreateConversationRequest>);

    impl CreateConversation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateConversationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Conversation> {
            (*self.0.stub)
                .create_conversation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateConversationRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [conversation][crate::model::CreateConversationRequest::conversation].
        ///
        /// This is a **required** field for requests.
        pub fn set_conversation<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Conversation>,
        {
            self.0.request.conversation = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [conversation][crate::model::CreateConversationRequest::conversation].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_conversation<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Conversation>,
        {
            self.0.request.conversation = v.map(|x| x.into());
            self
        }

        /// Sets the value of [conversation_id][crate::model::CreateConversationRequest::conversation_id].
        pub fn set_conversation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.conversation_id = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateConversation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::upload_conversation][crate::client::ContactCenterInsights::upload_conversation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UploadConversation;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UploadConversation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UploadConversation(RequestBuilder<crate::model::UploadConversationRequest>);

    impl UploadConversation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UploadConversationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [upload_conversation][crate::client::ContactCenterInsights::upload_conversation].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .upload_conversation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `upload_conversation`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<crate::model::Conversation, crate::model::UploadConversationMetadata>
        {
            type Operation = lro::internal::Operation<
                crate::model::Conversation,
                crate::model::UploadConversationMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::UploadConversationRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [conversation][crate::model::UploadConversationRequest::conversation].
        ///
        /// This is a **required** field for requests.
        pub fn set_conversation<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Conversation>,
        {
            self.0.request.conversation = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [conversation][crate::model::UploadConversationRequest::conversation].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_conversation<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Conversation>,
        {
            self.0.request.conversation = v.map(|x| x.into());
            self
        }

        /// Sets the value of [conversation_id][crate::model::UploadConversationRequest::conversation_id].
        pub fn set_conversation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.conversation_id = v.into();
            self
        }

        /// Sets the value of [redaction_config][crate::model::UploadConversationRequest::redaction_config].
        pub fn set_redaction_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::RedactionConfig>,
        {
            self.0.request.redaction_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [redaction_config][crate::model::UploadConversationRequest::redaction_config].
        pub fn set_or_clear_redaction_config<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::RedactionConfig>,
        {
            self.0.request.redaction_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [speech_config][crate::model::UploadConversationRequest::speech_config].
        pub fn set_speech_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SpeechConfig>,
        {
            self.0.request.speech_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [speech_config][crate::model::UploadConversationRequest::speech_config].
        pub fn set_or_clear_speech_config<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SpeechConfig>,
        {
            self.0.request.speech_config = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UploadConversation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_conversation][crate::client::ContactCenterInsights::update_conversation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdateConversation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateConversation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateConversation(RequestBuilder<crate::model::UpdateConversationRequest>);

    impl UpdateConversation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateConversationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Conversation> {
            (*self.0.stub)
                .update_conversation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [conversation][crate::model::UpdateConversationRequest::conversation].
        ///
        /// This is a **required** field for requests.
        pub fn set_conversation<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Conversation>,
        {
            self.0.request.conversation = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [conversation][crate::model::UpdateConversationRequest::conversation].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_conversation<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Conversation>,
        {
            self.0.request.conversation = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateConversationRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateConversationRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateConversation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_conversation][crate::client::ContactCenterInsights::get_conversation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetConversation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetConversation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetConversation(RequestBuilder<crate::model::GetConversationRequest>);

    impl GetConversation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetConversationRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Conversation> {
            (*self.0.stub)
                .get_conversation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetConversationRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [view][crate::model::GetConversationRequest::view].
        pub fn set_view<T: Into<crate::model::ConversationView>>(mut self, v: T) -> Self {
            self.0.request.view = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetConversation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_conversations][crate::client::ContactCenterInsights::list_conversations] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListConversations;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListConversations {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListConversations(RequestBuilder<crate::model::ListConversationsRequest>);

    impl ListConversations {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListConversationsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListConversationsResponse> {
            (*self.0.stub)
                .list_conversations(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListConversationsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListConversationsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListConversationsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListConversationsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListConversationsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ListConversationsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [order_by][crate::model::ListConversationsRequest::order_by].
        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.order_by = v.into();
            self
        }

        /// Sets the value of [view][crate::model::ListConversationsRequest::view].
        pub fn set_view<T: Into<crate::model::ConversationView>>(mut self, v: T) -> Self {
            self.0.request.view = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListConversations {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_conversation][crate::client::ContactCenterInsights::delete_conversation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteConversation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteConversation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteConversation(RequestBuilder<crate::model::DeleteConversationRequest>);

    impl DeleteConversation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteConversationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_conversation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteConversationRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [force][crate::model::DeleteConversationRequest::force].
        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.force = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteConversation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::create_analysis][crate::client::ContactCenterInsights::create_analysis] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreateAnalysis;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateAnalysis {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateAnalysis(RequestBuilder<crate::model::CreateAnalysisRequest>);

    impl CreateAnalysis {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateAnalysisRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [create_analysis][crate::client::ContactCenterInsights::create_analysis].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .create_analysis(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `create_analysis`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<crate::model::Analysis, crate::model::CreateAnalysisOperationMetadata>
        {
            type Operation = lro::internal::Operation<
                crate::model::Analysis,
                crate::model::CreateAnalysisOperationMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::CreateAnalysisRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [analysis][crate::model::CreateAnalysisRequest::analysis].
        ///
        /// This is a **required** field for requests.
        pub fn set_analysis<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Analysis>,
        {
            self.0.request.analysis = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [analysis][crate::model::CreateAnalysisRequest::analysis].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_analysis<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Analysis>,
        {
            self.0.request.analysis = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateAnalysis {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_analysis][crate::client::ContactCenterInsights::get_analysis] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetAnalysis;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetAnalysis {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetAnalysis(RequestBuilder<crate::model::GetAnalysisRequest>);

    impl GetAnalysis {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetAnalysisRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Analysis> {
            (*self.0.stub)
                .get_analysis(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetAnalysisRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetAnalysis {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_analyses][crate::client::ContactCenterInsights::list_analyses] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListAnalyses;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListAnalyses {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListAnalyses(RequestBuilder<crate::model::ListAnalysesRequest>);

    impl ListAnalyses {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListAnalysesRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListAnalysesResponse> {
            (*self.0.stub)
                .list_analyses(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListAnalysesResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAnalysesResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListAnalysesRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListAnalysesRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListAnalysesRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ListAnalysesRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListAnalyses {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_analysis][crate::client::ContactCenterInsights::delete_analysis] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteAnalysis;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteAnalysis {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteAnalysis(RequestBuilder<crate::model::DeleteAnalysisRequest>);

    impl DeleteAnalysis {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteAnalysisRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_analysis(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteAnalysisRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteAnalysis {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::bulk_analyze_conversations][crate::client::ContactCenterInsights::bulk_analyze_conversations] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::BulkAnalyzeConversations;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> BulkAnalyzeConversations {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct BulkAnalyzeConversations(
        RequestBuilder<crate::model::BulkAnalyzeConversationsRequest>,
    );

    impl BulkAnalyzeConversations {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::BulkAnalyzeConversationsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [bulk_analyze_conversations][crate::client::ContactCenterInsights::bulk_analyze_conversations].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .bulk_analyze_conversations(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `bulk_analyze_conversations`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::BulkAnalyzeConversationsResponse,
            crate::model::BulkAnalyzeConversationsMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::BulkAnalyzeConversationsResponse,
                crate::model::BulkAnalyzeConversationsMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::BulkAnalyzeConversationsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::BulkAnalyzeConversationsRequest::filter].
        ///
        /// This is a **required** field for requests.
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [analysis_percentage][crate::model::BulkAnalyzeConversationsRequest::analysis_percentage].
        ///
        /// This is a **required** field for requests.
        pub fn set_analysis_percentage<T: Into<f32>>(mut self, v: T) -> Self {
            self.0.request.analysis_percentage = v.into();
            self
        }

        /// Sets the value of [annotator_selector][crate::model::BulkAnalyzeConversationsRequest::annotator_selector].
        pub fn set_annotator_selector<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::AnnotatorSelector>,
        {
            self.0.request.annotator_selector = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [annotator_selector][crate::model::BulkAnalyzeConversationsRequest::annotator_selector].
        pub fn set_or_clear_annotator_selector<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::AnnotatorSelector>,
        {
            self.0.request.annotator_selector = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for BulkAnalyzeConversations {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::bulk_delete_conversations][crate::client::ContactCenterInsights::bulk_delete_conversations] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::BulkDeleteConversations;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> BulkDeleteConversations {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct BulkDeleteConversations(
        RequestBuilder<crate::model::BulkDeleteConversationsRequest>,
    );

    impl BulkDeleteConversations {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::BulkDeleteConversationsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [bulk_delete_conversations][crate::client::ContactCenterInsights::bulk_delete_conversations].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .bulk_delete_conversations(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `bulk_delete_conversations`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::BulkDeleteConversationsResponse,
            crate::model::BulkDeleteConversationsMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::BulkDeleteConversationsResponse,
                crate::model::BulkDeleteConversationsMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::BulkDeleteConversationsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::BulkDeleteConversationsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [max_delete_count][crate::model::BulkDeleteConversationsRequest::max_delete_count].
        pub fn set_max_delete_count<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.max_delete_count = v.into();
            self
        }

        /// Sets the value of [force][crate::model::BulkDeleteConversationsRequest::force].
        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.force = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for BulkDeleteConversations {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::ingest_conversations][crate::client::ContactCenterInsights::ingest_conversations] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::IngestConversations;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> IngestConversations {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct IngestConversations(RequestBuilder<crate::model::IngestConversationsRequest>);

    impl IngestConversations {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::IngestConversationsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [ingest_conversations][crate::client::ContactCenterInsights::ingest_conversations].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .ingest_conversations(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `ingest_conversations`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::IngestConversationsResponse,
            crate::model::IngestConversationsMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::IngestConversationsResponse,
                crate::model::IngestConversationsMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::IngestConversationsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [conversation_config][crate::model::IngestConversationsRequest::conversation_config].
        pub fn set_conversation_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::ingest_conversations_request::ConversationConfig>,
        {
            self.0.request.conversation_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [conversation_config][crate::model::IngestConversationsRequest::conversation_config].
        pub fn set_or_clear_conversation_config<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::ingest_conversations_request::ConversationConfig>,
        {
            self.0.request.conversation_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [redaction_config][crate::model::IngestConversationsRequest::redaction_config].
        pub fn set_redaction_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::RedactionConfig>,
        {
            self.0.request.redaction_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [redaction_config][crate::model::IngestConversationsRequest::redaction_config].
        pub fn set_or_clear_redaction_config<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::RedactionConfig>,
        {
            self.0.request.redaction_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [speech_config][crate::model::IngestConversationsRequest::speech_config].
        pub fn set_speech_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SpeechConfig>,
        {
            self.0.request.speech_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [speech_config][crate::model::IngestConversationsRequest::speech_config].
        pub fn set_or_clear_speech_config<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SpeechConfig>,
        {
            self.0.request.speech_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [sample_size][crate::model::IngestConversationsRequest::sample_size].
        pub fn set_sample_size<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.sample_size = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [sample_size][crate::model::IngestConversationsRequest::sample_size].
        pub fn set_or_clear_sample_size<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.sample_size = v.map(|x| x.into());
            self
        }

        /// Sets the value of [source][crate::model::IngestConversationsRequest::source].
        ///
        /// Note that all the setters affecting `source` are
        /// mutually exclusive.
        pub fn set_source<T: Into<Option<crate::model::ingest_conversations_request::Source>>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.source = v.into();
            self
        }

        /// Sets the value of [source][crate::model::IngestConversationsRequest::source]
        /// to hold a `GcsSource`.
        ///
        /// Note that all the setters affecting `source` are
        /// mutually exclusive.
        pub fn set_gcs_source<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::ingest_conversations_request::GcsSource>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_gcs_source(v);
            self
        }

        /// Sets the value of [object_config][crate::model::IngestConversationsRequest::object_config].
        ///
        /// Note that all the setters affecting `object_config` are
        /// mutually exclusive.
        pub fn set_object_config<
            T: Into<Option<crate::model::ingest_conversations_request::ObjectConfig>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.object_config = v.into();
            self
        }

        /// Sets the value of [object_config][crate::model::IngestConversationsRequest::object_config]
        /// to hold a `TranscriptObjectConfig`.
        ///
        /// Note that all the setters affecting `object_config` are
        /// mutually exclusive.
        pub fn set_transcript_object_config<
            T: std::convert::Into<
                    std::boxed::Box<
                        crate::model::ingest_conversations_request::TranscriptObjectConfig,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_transcript_object_config(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for IngestConversations {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::export_insights_data][crate::client::ContactCenterInsights::export_insights_data] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ExportInsightsData;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ExportInsightsData {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ExportInsightsData(RequestBuilder<crate::model::ExportInsightsDataRequest>);

    impl ExportInsightsData {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ExportInsightsDataRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [export_insights_data][crate::client::ContactCenterInsights::export_insights_data].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .export_insights_data(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `export_insights_data`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::ExportInsightsDataResponse,
            crate::model::ExportInsightsDataMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::ExportInsightsDataResponse,
                crate::model::ExportInsightsDataMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::ExportInsightsDataRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ExportInsightsDataRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [kms_key][crate::model::ExportInsightsDataRequest::kms_key].
        pub fn set_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.kms_key = v.into();
            self
        }

        /// Sets the value of [write_disposition][crate::model::ExportInsightsDataRequest::write_disposition].
        pub fn set_write_disposition<
            T: Into<crate::model::export_insights_data_request::WriteDisposition>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.write_disposition = v.into();
            self
        }

        /// Sets the value of [destination][crate::model::ExportInsightsDataRequest::destination].
        ///
        /// Note that all the setters affecting `destination` are
        /// mutually exclusive.
        pub fn set_destination<
            T: Into<Option<crate::model::export_insights_data_request::Destination>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.destination = v.into();
            self
        }

        /// Sets the value of [destination][crate::model::ExportInsightsDataRequest::destination]
        /// to hold a `BigQueryDestination`.
        ///
        /// Note that all the setters affecting `destination` are
        /// mutually exclusive.
        pub fn set_big_query_destination<
            T: std::convert::Into<
                    std::boxed::Box<
                        crate::model::export_insights_data_request::BigQueryDestination,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_big_query_destination(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ExportInsightsData {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::create_issue_model][crate::client::ContactCenterInsights::create_issue_model] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreateIssueModel;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateIssueModel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateIssueModel(RequestBuilder<crate::model::CreateIssueModelRequest>);

    impl CreateIssueModel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateIssueModelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [create_issue_model][crate::client::ContactCenterInsights::create_issue_model].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .create_issue_model(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `create_issue_model`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<crate::model::IssueModel, crate::model::CreateIssueModelMetadata>
        {
            type Operation = lro::internal::Operation<
                crate::model::IssueModel,
                crate::model::CreateIssueModelMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::CreateIssueModelRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [issue_model][crate::model::CreateIssueModelRequest::issue_model].
        ///
        /// This is a **required** field for requests.
        pub fn set_issue_model<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IssueModel>,
        {
            self.0.request.issue_model = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [issue_model][crate::model::CreateIssueModelRequest::issue_model].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_issue_model<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::IssueModel>,
        {
            self.0.request.issue_model = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateIssueModel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_issue_model][crate::client::ContactCenterInsights::update_issue_model] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdateIssueModel;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateIssueModel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateIssueModel(RequestBuilder<crate::model::UpdateIssueModelRequest>);

    impl UpdateIssueModel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateIssueModelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::IssueModel> {
            (*self.0.stub)
                .update_issue_model(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [issue_model][crate::model::UpdateIssueModelRequest::issue_model].
        ///
        /// This is a **required** field for requests.
        pub fn set_issue_model<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IssueModel>,
        {
            self.0.request.issue_model = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [issue_model][crate::model::UpdateIssueModelRequest::issue_model].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_issue_model<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::IssueModel>,
        {
            self.0.request.issue_model = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateIssueModelRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateIssueModelRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateIssueModel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_issue_model][crate::client::ContactCenterInsights::get_issue_model] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetIssueModel;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetIssueModel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetIssueModel(RequestBuilder<crate::model::GetIssueModelRequest>);

    impl GetIssueModel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetIssueModelRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::IssueModel> {
            (*self.0.stub)
                .get_issue_model(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetIssueModelRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetIssueModel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_issue_models][crate::client::ContactCenterInsights::list_issue_models] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListIssueModels;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListIssueModels {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListIssueModels(RequestBuilder<crate::model::ListIssueModelsRequest>);

    impl ListIssueModels {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListIssueModelsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListIssueModelsResponse> {
            (*self.0.stub)
                .list_issue_models(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListIssueModelsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListIssueModels {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_issue_model][crate::client::ContactCenterInsights::delete_issue_model] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteIssueModel;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteIssueModel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteIssueModel(RequestBuilder<crate::model::DeleteIssueModelRequest>);

    impl DeleteIssueModel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteIssueModelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [delete_issue_model][crate::client::ContactCenterInsights::delete_issue_model].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .delete_issue_model(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `delete_issue_model`.
        pub fn poller(self) -> impl lro::Poller<(), crate::model::DeleteIssueModelMetadata> {
            type Operation =
                lro::internal::Operation<wkt::Empty, crate::model::DeleteIssueModelMetadata>;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_unit_response_poller(
                polling_error_policy,
                polling_backoff_policy,
                start,
                query,
            )
        }

        /// Sets the value of [name][crate::model::DeleteIssueModelRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteIssueModel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::deploy_issue_model][crate::client::ContactCenterInsights::deploy_issue_model] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeployIssueModel;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeployIssueModel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeployIssueModel(RequestBuilder<crate::model::DeployIssueModelRequest>);

    impl DeployIssueModel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeployIssueModelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [deploy_issue_model][crate::client::ContactCenterInsights::deploy_issue_model].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .deploy_issue_model(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `deploy_issue_model`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::DeployIssueModelResponse,
            crate::model::DeployIssueModelMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::DeployIssueModelResponse,
                crate::model::DeployIssueModelMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [name][crate::model::DeployIssueModelRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeployIssueModel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::undeploy_issue_model][crate::client::ContactCenterInsights::undeploy_issue_model] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UndeployIssueModel;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UndeployIssueModel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UndeployIssueModel(RequestBuilder<crate::model::UndeployIssueModelRequest>);

    impl UndeployIssueModel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UndeployIssueModelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [undeploy_issue_model][crate::client::ContactCenterInsights::undeploy_issue_model].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .undeploy_issue_model(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `undeploy_issue_model`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::UndeployIssueModelResponse,
            crate::model::UndeployIssueModelMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::UndeployIssueModelResponse,
                crate::model::UndeployIssueModelMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [name][crate::model::UndeployIssueModelRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UndeployIssueModel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::export_issue_model][crate::client::ContactCenterInsights::export_issue_model] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ExportIssueModel;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ExportIssueModel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ExportIssueModel(RequestBuilder<crate::model::ExportIssueModelRequest>);

    impl ExportIssueModel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ExportIssueModelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [export_issue_model][crate::client::ContactCenterInsights::export_issue_model].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .export_issue_model(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `export_issue_model`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::ExportIssueModelResponse,
            crate::model::ExportIssueModelMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::ExportIssueModelResponse,
                crate::model::ExportIssueModelMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [name][crate::model::ExportIssueModelRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [destination][crate::model::ExportIssueModelRequest::destination].
        ///
        /// Note that all the setters affecting `destination` are
        /// mutually exclusive.
        pub fn set_destination<
            T: Into<Option<crate::model::export_issue_model_request::Destination>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.destination = v.into();
            self
        }

        /// Sets the value of [destination][crate::model::ExportIssueModelRequest::destination]
        /// to hold a `GcsDestination`.
        ///
        /// Note that all the setters affecting `destination` are
        /// mutually exclusive.
        pub fn set_gcs_destination<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::export_issue_model_request::GcsDestination>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_gcs_destination(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ExportIssueModel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::import_issue_model][crate::client::ContactCenterInsights::import_issue_model] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ImportIssueModel;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ImportIssueModel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ImportIssueModel(RequestBuilder<crate::model::ImportIssueModelRequest>);

    impl ImportIssueModel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ImportIssueModelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [import_issue_model][crate::client::ContactCenterInsights::import_issue_model].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .import_issue_model(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `import_issue_model`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::ImportIssueModelResponse,
            crate::model::ImportIssueModelMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::ImportIssueModelResponse,
                crate::model::ImportIssueModelMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::ImportIssueModelRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [create_new_model][crate::model::ImportIssueModelRequest::create_new_model].
        pub fn set_create_new_model<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.create_new_model = v.into();
            self
        }

        /// Sets the value of [source][crate::model::ImportIssueModelRequest::source].
        ///
        /// Note that all the setters affecting `source` are
        /// mutually exclusive.
        pub fn set_source<T: Into<Option<crate::model::import_issue_model_request::Source>>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.source = v.into();
            self
        }

        /// Sets the value of [source][crate::model::ImportIssueModelRequest::source]
        /// to hold a `GcsSource`.
        ///
        /// Note that all the setters affecting `source` are
        /// mutually exclusive.
        pub fn set_gcs_source<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::import_issue_model_request::GcsSource>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_gcs_source(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ImportIssueModel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_issue][crate::client::ContactCenterInsights::get_issue] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetIssue;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetIssue {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetIssue(RequestBuilder<crate::model::GetIssueRequest>);

    impl GetIssue {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetIssueRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Issue> {
            (*self.0.stub)
                .get_issue(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetIssueRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetIssue {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_issues][crate::client::ContactCenterInsights::list_issues] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListIssues;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListIssues {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListIssues(RequestBuilder<crate::model::ListIssuesRequest>);

    impl ListIssues {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListIssuesRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListIssuesResponse> {
            (*self.0.stub)
                .list_issues(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListIssuesRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListIssues {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_issue][crate::client::ContactCenterInsights::update_issue] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdateIssue;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateIssue {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateIssue(RequestBuilder<crate::model::UpdateIssueRequest>);

    impl UpdateIssue {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateIssueRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Issue> {
            (*self.0.stub)
                .update_issue(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [issue][crate::model::UpdateIssueRequest::issue].
        ///
        /// This is a **required** field for requests.
        pub fn set_issue<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Issue>,
        {
            self.0.request.issue = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [issue][crate::model::UpdateIssueRequest::issue].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Issue>,
        {
            self.0.request.issue = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateIssue {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_issue][crate::client::ContactCenterInsights::delete_issue] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteIssue;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteIssue {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteIssue(RequestBuilder<crate::model::DeleteIssueRequest>);

    impl DeleteIssue {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteIssueRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_issue(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteIssueRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteIssue {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::calculate_issue_model_stats][crate::client::ContactCenterInsights::calculate_issue_model_stats] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CalculateIssueModelStats;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CalculateIssueModelStats {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CalculateIssueModelStats(
        RequestBuilder<crate::model::CalculateIssueModelStatsRequest>,
    );

    impl CalculateIssueModelStats {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CalculateIssueModelStatsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::CalculateIssueModelStatsResponse> {
            (*self.0.stub)
                .calculate_issue_model_stats(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [issue_model][crate::model::CalculateIssueModelStatsRequest::issue_model].
        ///
        /// This is a **required** field for requests.
        pub fn set_issue_model<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.issue_model = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CalculateIssueModelStats {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::create_phrase_matcher][crate::client::ContactCenterInsights::create_phrase_matcher] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreatePhraseMatcher;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreatePhraseMatcher {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreatePhraseMatcher(RequestBuilder<crate::model::CreatePhraseMatcherRequest>);

    impl CreatePhraseMatcher {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreatePhraseMatcherRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::PhraseMatcher> {
            (*self.0.stub)
                .create_phrase_matcher(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreatePhraseMatcherRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [phrase_matcher][crate::model::CreatePhraseMatcherRequest::phrase_matcher].
        ///
        /// This is a **required** field for requests.
        pub fn set_phrase_matcher<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::PhraseMatcher>,
        {
            self.0.request.phrase_matcher = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [phrase_matcher][crate::model::CreatePhraseMatcherRequest::phrase_matcher].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_phrase_matcher<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::PhraseMatcher>,
        {
            self.0.request.phrase_matcher = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreatePhraseMatcher {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_phrase_matcher][crate::client::ContactCenterInsights::get_phrase_matcher] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetPhraseMatcher;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetPhraseMatcher {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetPhraseMatcher(RequestBuilder<crate::model::GetPhraseMatcherRequest>);

    impl GetPhraseMatcher {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetPhraseMatcherRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::PhraseMatcher> {
            (*self.0.stub)
                .get_phrase_matcher(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetPhraseMatcherRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetPhraseMatcher {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_phrase_matchers][crate::client::ContactCenterInsights::list_phrase_matchers] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListPhraseMatchers;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListPhraseMatchers {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListPhraseMatchers(RequestBuilder<crate::model::ListPhraseMatchersRequest>);

    impl ListPhraseMatchers {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListPhraseMatchersRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListPhraseMatchersResponse> {
            (*self.0.stub)
                .list_phrase_matchers(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListPhraseMatchersResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::ListPhraseMatchersResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListPhraseMatchersRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListPhraseMatchersRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListPhraseMatchersRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ListPhraseMatchersRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListPhraseMatchers {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_phrase_matcher][crate::client::ContactCenterInsights::delete_phrase_matcher] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeletePhraseMatcher;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeletePhraseMatcher {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeletePhraseMatcher(RequestBuilder<crate::model::DeletePhraseMatcherRequest>);

    impl DeletePhraseMatcher {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeletePhraseMatcherRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_phrase_matcher(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeletePhraseMatcherRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeletePhraseMatcher {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_phrase_matcher][crate::client::ContactCenterInsights::update_phrase_matcher] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdatePhraseMatcher;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdatePhraseMatcher {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdatePhraseMatcher(RequestBuilder<crate::model::UpdatePhraseMatcherRequest>);

    impl UpdatePhraseMatcher {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdatePhraseMatcherRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::PhraseMatcher> {
            (*self.0.stub)
                .update_phrase_matcher(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [phrase_matcher][crate::model::UpdatePhraseMatcherRequest::phrase_matcher].
        ///
        /// This is a **required** field for requests.
        pub fn set_phrase_matcher<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::PhraseMatcher>,
        {
            self.0.request.phrase_matcher = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [phrase_matcher][crate::model::UpdatePhraseMatcherRequest::phrase_matcher].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_phrase_matcher<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::PhraseMatcher>,
        {
            self.0.request.phrase_matcher = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdatePhraseMatcherRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdatePhraseMatcherRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdatePhraseMatcher {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::calculate_stats][crate::client::ContactCenterInsights::calculate_stats] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CalculateStats;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CalculateStats {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CalculateStats(RequestBuilder<crate::model::CalculateStatsRequest>);

    impl CalculateStats {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CalculateStatsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::CalculateStatsResponse> {
            (*self.0.stub)
                .calculate_stats(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [location][crate::model::CalculateStatsRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::CalculateStatsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CalculateStats {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_settings][crate::client::ContactCenterInsights::get_settings] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetSettings;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSettings {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSettings(RequestBuilder<crate::model::GetSettingsRequest>);

    impl GetSettings {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetSettingsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Settings> {
            (*self.0.stub)
                .get_settings(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetSettingsRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetSettings {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_settings][crate::client::ContactCenterInsights::update_settings] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdateSettings;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateSettings {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateSettings(RequestBuilder<crate::model::UpdateSettingsRequest>);

    impl UpdateSettings {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateSettingsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Settings> {
            (*self.0.stub)
                .update_settings(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [settings][crate::model::UpdateSettingsRequest::settings].
        ///
        /// This is a **required** field for requests.
        pub fn set_settings<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Settings>,
        {
            self.0.request.settings = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [settings][crate::model::UpdateSettingsRequest::settings].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Settings>,
        {
            self.0.request.settings = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateSettingsRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateSettingsRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateSettings {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::create_analysis_rule][crate::client::ContactCenterInsights::create_analysis_rule] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreateAnalysisRule;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateAnalysisRule {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateAnalysisRule(RequestBuilder<crate::model::CreateAnalysisRuleRequest>);

    impl CreateAnalysisRule {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateAnalysisRuleRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::AnalysisRule> {
            (*self.0.stub)
                .create_analysis_rule(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateAnalysisRuleRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [analysis_rule][crate::model::CreateAnalysisRuleRequest::analysis_rule].
        ///
        /// This is a **required** field for requests.
        pub fn set_analysis_rule<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::AnalysisRule>,
        {
            self.0.request.analysis_rule = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [analysis_rule][crate::model::CreateAnalysisRuleRequest::analysis_rule].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_analysis_rule<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::AnalysisRule>,
        {
            self.0.request.analysis_rule = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateAnalysisRule {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_analysis_rule][crate::client::ContactCenterInsights::get_analysis_rule] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetAnalysisRule;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetAnalysisRule {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetAnalysisRule(RequestBuilder<crate::model::GetAnalysisRuleRequest>);

    impl GetAnalysisRule {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetAnalysisRuleRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::AnalysisRule> {
            (*self.0.stub)
                .get_analysis_rule(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetAnalysisRuleRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetAnalysisRule {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_analysis_rules][crate::client::ContactCenterInsights::list_analysis_rules] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListAnalysisRules;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListAnalysisRules {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListAnalysisRules(RequestBuilder<crate::model::ListAnalysisRulesRequest>);

    impl ListAnalysisRules {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListAnalysisRulesRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListAnalysisRulesResponse> {
            (*self.0.stub)
                .list_analysis_rules(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListAnalysisRulesResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAnalysisRulesResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListAnalysisRulesRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListAnalysisRulesRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListAnalysisRulesRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListAnalysisRules {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_analysis_rule][crate::client::ContactCenterInsights::update_analysis_rule] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdateAnalysisRule;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateAnalysisRule {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateAnalysisRule(RequestBuilder<crate::model::UpdateAnalysisRuleRequest>);

    impl UpdateAnalysisRule {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateAnalysisRuleRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::AnalysisRule> {
            (*self.0.stub)
                .update_analysis_rule(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [analysis_rule][crate::model::UpdateAnalysisRuleRequest::analysis_rule].
        ///
        /// This is a **required** field for requests.
        pub fn set_analysis_rule<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::AnalysisRule>,
        {
            self.0.request.analysis_rule = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [analysis_rule][crate::model::UpdateAnalysisRuleRequest::analysis_rule].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_analysis_rule<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::AnalysisRule>,
        {
            self.0.request.analysis_rule = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateAnalysisRuleRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateAnalysisRuleRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateAnalysisRule {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_analysis_rule][crate::client::ContactCenterInsights::delete_analysis_rule] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteAnalysisRule;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteAnalysisRule {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteAnalysisRule(RequestBuilder<crate::model::DeleteAnalysisRuleRequest>);

    impl DeleteAnalysisRule {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteAnalysisRuleRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_analysis_rule(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteAnalysisRuleRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteAnalysisRule {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_encryption_spec][crate::client::ContactCenterInsights::get_encryption_spec] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetEncryptionSpec;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetEncryptionSpec {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetEncryptionSpec(RequestBuilder<crate::model::GetEncryptionSpecRequest>);

    impl GetEncryptionSpec {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetEncryptionSpecRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::EncryptionSpec> {
            (*self.0.stub)
                .get_encryption_spec(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetEncryptionSpecRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetEncryptionSpec {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::initialize_encryption_spec][crate::client::ContactCenterInsights::initialize_encryption_spec] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::InitializeEncryptionSpec;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> InitializeEncryptionSpec {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct InitializeEncryptionSpec(
        RequestBuilder<crate::model::InitializeEncryptionSpecRequest>,
    );

    impl InitializeEncryptionSpec {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::InitializeEncryptionSpecRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [initialize_encryption_spec][crate::client::ContactCenterInsights::initialize_encryption_spec].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .initialize_encryption_spec(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `initialize_encryption_spec`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::InitializeEncryptionSpecResponse,
            crate::model::InitializeEncryptionSpecMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::InitializeEncryptionSpecResponse,
                crate::model::InitializeEncryptionSpecMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
        ///
        /// This is a **required** field for requests.
        pub fn set_encryption_spec<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::EncryptionSpec>,
        {
            self.0.request.encryption_spec = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [encryption_spec][crate::model::InitializeEncryptionSpecRequest::encryption_spec].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_encryption_spec<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::EncryptionSpec>,
        {
            self.0.request.encryption_spec = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for InitializeEncryptionSpec {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::create_view][crate::client::ContactCenterInsights::create_view] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreateView;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateView {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateView(RequestBuilder<crate::model::CreateViewRequest>);

    impl CreateView {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateViewRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::View> {
            (*self.0.stub)
                .create_view(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateViewRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [view][crate::model::CreateViewRequest::view].
        ///
        /// This is a **required** field for requests.
        pub fn set_view<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::View>,
        {
            self.0.request.view = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [view][crate::model::CreateViewRequest::view].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_view<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::View>,
        {
            self.0.request.view = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateView {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_view][crate::client::ContactCenterInsights::get_view] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetView;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetView {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetView(RequestBuilder<crate::model::GetViewRequest>);

    impl GetView {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetViewRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::View> {
            (*self.0.stub)
                .get_view(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetViewRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetView {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_views][crate::client::ContactCenterInsights::list_views] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListViews;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListViews {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListViews(RequestBuilder<crate::model::ListViewsRequest>);

    impl ListViews {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListViewsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListViewsResponse> {
            (*self.0.stub)
                .list_views(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListViewsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListViewsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListViewsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListViewsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListViewsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListViews {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_view][crate::client::ContactCenterInsights::update_view] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdateView;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateView {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateView(RequestBuilder<crate::model::UpdateViewRequest>);

    impl UpdateView {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateViewRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::View> {
            (*self.0.stub)
                .update_view(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [view][crate::model::UpdateViewRequest::view].
        ///
        /// This is a **required** field for requests.
        pub fn set_view<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::View>,
        {
            self.0.request.view = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [view][crate::model::UpdateViewRequest::view].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_view<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::View>,
        {
            self.0.request.view = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateViewRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateViewRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateView {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_view][crate::client::ContactCenterInsights::delete_view] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteView;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteView {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteView(RequestBuilder<crate::model::DeleteViewRequest>);

    impl DeleteView {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteViewRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_view(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteViewRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteView {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::query_metrics][crate::client::ContactCenterInsights::query_metrics] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::QueryMetrics;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> QueryMetrics {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct QueryMetrics(RequestBuilder<crate::model::QueryMetricsRequest>);

    impl QueryMetrics {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::QueryMetricsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [query_metrics][crate::client::ContactCenterInsights::query_metrics].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .query_metrics(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `query_metrics`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<crate::model::QueryMetricsResponse, crate::model::QueryMetricsMetadata>
        {
            type Operation = lro::internal::Operation<
                crate::model::QueryMetricsResponse,
                crate::model::QueryMetricsMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [location][crate::model::QueryMetricsRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::QueryMetricsRequest::filter].
        ///
        /// This is a **required** field for requests.
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [time_granularity][crate::model::QueryMetricsRequest::time_granularity].
        pub fn set_time_granularity<
            T: Into<crate::model::query_metrics_request::TimeGranularity>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.time_granularity = v.into();
            self
        }

        /// Sets the value of [dimensions][crate::model::QueryMetricsRequest::dimensions].
        pub fn set_dimensions<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::Dimension>,
        {
            use std::iter::Iterator;
            self.0.request.dimensions = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [measure_mask][crate::model::QueryMetricsRequest::measure_mask].
        pub fn set_measure_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.measure_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [measure_mask][crate::model::QueryMetricsRequest::measure_mask].
        pub fn set_or_clear_measure_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.measure_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for QueryMetrics {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::create_qa_question][crate::client::ContactCenterInsights::create_qa_question] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreateQaQuestion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateQaQuestion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateQaQuestion(RequestBuilder<crate::model::CreateQaQuestionRequest>);

    impl CreateQaQuestion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateQaQuestionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaQuestion> {
            (*self.0.stub)
                .create_qa_question(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateQaQuestionRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [qa_question][crate::model::CreateQaQuestionRequest::qa_question].
        ///
        /// This is a **required** field for requests.
        pub fn set_qa_question<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::QaQuestion>,
        {
            self.0.request.qa_question = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [qa_question][crate::model::CreateQaQuestionRequest::qa_question].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_qa_question<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::QaQuestion>,
        {
            self.0.request.qa_question = v.map(|x| x.into());
            self
        }

        /// Sets the value of [qa_question_id][crate::model::CreateQaQuestionRequest::qa_question_id].
        pub fn set_qa_question_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.qa_question_id = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateQaQuestion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_qa_question][crate::client::ContactCenterInsights::get_qa_question] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetQaQuestion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetQaQuestion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetQaQuestion(RequestBuilder<crate::model::GetQaQuestionRequest>);

    impl GetQaQuestion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetQaQuestionRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaQuestion> {
            (*self.0.stub)
                .get_qa_question(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetQaQuestionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetQaQuestion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_qa_question][crate::client::ContactCenterInsights::update_qa_question] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdateQaQuestion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateQaQuestion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateQaQuestion(RequestBuilder<crate::model::UpdateQaQuestionRequest>);

    impl UpdateQaQuestion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateQaQuestionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaQuestion> {
            (*self.0.stub)
                .update_qa_question(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [qa_question][crate::model::UpdateQaQuestionRequest::qa_question].
        ///
        /// This is a **required** field for requests.
        pub fn set_qa_question<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::QaQuestion>,
        {
            self.0.request.qa_question = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [qa_question][crate::model::UpdateQaQuestionRequest::qa_question].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_qa_question<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::QaQuestion>,
        {
            self.0.request.qa_question = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateQaQuestionRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateQaQuestionRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateQaQuestion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_qa_question][crate::client::ContactCenterInsights::delete_qa_question] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteQaQuestion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteQaQuestion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteQaQuestion(RequestBuilder<crate::model::DeleteQaQuestionRequest>);

    impl DeleteQaQuestion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteQaQuestionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_qa_question(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteQaQuestionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteQaQuestion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_qa_questions][crate::client::ContactCenterInsights::list_qa_questions] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListQaQuestions;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListQaQuestions {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListQaQuestions(RequestBuilder<crate::model::ListQaQuestionsRequest>);

    impl ListQaQuestions {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListQaQuestionsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListQaQuestionsResponse> {
            (*self.0.stub)
                .list_qa_questions(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListQaQuestionsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListQaQuestionsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListQaQuestionsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListQaQuestionsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListQaQuestionsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListQaQuestions {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::create_qa_scorecard][crate::client::ContactCenterInsights::create_qa_scorecard] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreateQaScorecard;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateQaScorecard {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateQaScorecard(RequestBuilder<crate::model::CreateQaScorecardRequest>);

    impl CreateQaScorecard {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateQaScorecardRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaScorecard> {
            (*self.0.stub)
                .create_qa_scorecard(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateQaScorecardRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [qa_scorecard][crate::model::CreateQaScorecardRequest::qa_scorecard].
        ///
        /// This is a **required** field for requests.
        pub fn set_qa_scorecard<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::QaScorecard>,
        {
            self.0.request.qa_scorecard = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [qa_scorecard][crate::model::CreateQaScorecardRequest::qa_scorecard].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_qa_scorecard<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::QaScorecard>,
        {
            self.0.request.qa_scorecard = v.map(|x| x.into());
            self
        }

        /// Sets the value of [qa_scorecard_id][crate::model::CreateQaScorecardRequest::qa_scorecard_id].
        pub fn set_qa_scorecard_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.qa_scorecard_id = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateQaScorecard {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_qa_scorecard][crate::client::ContactCenterInsights::get_qa_scorecard] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetQaScorecard;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetQaScorecard {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetQaScorecard(RequestBuilder<crate::model::GetQaScorecardRequest>);

    impl GetQaScorecard {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetQaScorecardRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaScorecard> {
            (*self.0.stub)
                .get_qa_scorecard(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetQaScorecardRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetQaScorecard {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_qa_scorecard][crate::client::ContactCenterInsights::update_qa_scorecard] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdateQaScorecard;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateQaScorecard {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateQaScorecard(RequestBuilder<crate::model::UpdateQaScorecardRequest>);

    impl UpdateQaScorecard {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateQaScorecardRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaScorecard> {
            (*self.0.stub)
                .update_qa_scorecard(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [qa_scorecard][crate::model::UpdateQaScorecardRequest::qa_scorecard].
        ///
        /// This is a **required** field for requests.
        pub fn set_qa_scorecard<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::QaScorecard>,
        {
            self.0.request.qa_scorecard = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [qa_scorecard][crate::model::UpdateQaScorecardRequest::qa_scorecard].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_qa_scorecard<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::QaScorecard>,
        {
            self.0.request.qa_scorecard = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateQaScorecardRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateQaScorecardRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateQaScorecard {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_qa_scorecard][crate::client::ContactCenterInsights::delete_qa_scorecard] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteQaScorecard;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteQaScorecard {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteQaScorecard(RequestBuilder<crate::model::DeleteQaScorecardRequest>);

    impl DeleteQaScorecard {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteQaScorecardRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_qa_scorecard(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteQaScorecardRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [force][crate::model::DeleteQaScorecardRequest::force].
        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.force = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteQaScorecard {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_qa_scorecards][crate::client::ContactCenterInsights::list_qa_scorecards] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListQaScorecards;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListQaScorecards {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListQaScorecards(RequestBuilder<crate::model::ListQaScorecardsRequest>);

    impl ListQaScorecards {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListQaScorecardsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListQaScorecardsResponse> {
            (*self.0.stub)
                .list_qa_scorecards(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListQaScorecardsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListQaScorecardsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListQaScorecardsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListQaScorecardsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListQaScorecardsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListQaScorecards {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::create_qa_scorecard_revision][crate::client::ContactCenterInsights::create_qa_scorecard_revision] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreateQaScorecardRevision;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateQaScorecardRevision {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateQaScorecardRevision(
        RequestBuilder<crate::model::CreateQaScorecardRevisionRequest>,
    );

    impl CreateQaScorecardRevision {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateQaScorecardRevisionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaScorecardRevision> {
            (*self.0.stub)
                .create_qa_scorecard_revision(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateQaScorecardRevisionRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [qa_scorecard_revision][crate::model::CreateQaScorecardRevisionRequest::qa_scorecard_revision].
        ///
        /// This is a **required** field for requests.
        pub fn set_qa_scorecard_revision<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::QaScorecardRevision>,
        {
            self.0.request.qa_scorecard_revision = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [qa_scorecard_revision][crate::model::CreateQaScorecardRevisionRequest::qa_scorecard_revision].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_qa_scorecard_revision<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::QaScorecardRevision>,
        {
            self.0.request.qa_scorecard_revision = v.map(|x| x.into());
            self
        }

        /// Sets the value of [qa_scorecard_revision_id][crate::model::CreateQaScorecardRevisionRequest::qa_scorecard_revision_id].
        pub fn set_qa_scorecard_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.qa_scorecard_revision_id = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateQaScorecardRevision {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_qa_scorecard_revision][crate::client::ContactCenterInsights::get_qa_scorecard_revision] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetQaScorecardRevision;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetQaScorecardRevision {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetQaScorecardRevision(RequestBuilder<crate::model::GetQaScorecardRevisionRequest>);

    impl GetQaScorecardRevision {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetQaScorecardRevisionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaScorecardRevision> {
            (*self.0.stub)
                .get_qa_scorecard_revision(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetQaScorecardRevisionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetQaScorecardRevision {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::tune_qa_scorecard_revision][crate::client::ContactCenterInsights::tune_qa_scorecard_revision] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::TuneQaScorecardRevision;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> TuneQaScorecardRevision {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct TuneQaScorecardRevision(
        RequestBuilder<crate::model::TuneQaScorecardRevisionRequest>,
    );

    impl TuneQaScorecardRevision {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::TuneQaScorecardRevisionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [tune_qa_scorecard_revision][crate::client::ContactCenterInsights::tune_qa_scorecard_revision].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .tune_qa_scorecard_revision(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `tune_qa_scorecard_revision`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::TuneQaScorecardRevisionResponse,
            crate::model::TuneQaScorecardRevisionMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::TuneQaScorecardRevisionResponse,
                crate::model::TuneQaScorecardRevisionMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::TuneQaScorecardRevisionRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::TuneQaScorecardRevisionRequest::filter].
        ///
        /// This is a **required** field for requests.
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [validate_only][crate::model::TuneQaScorecardRevisionRequest::validate_only].
        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.validate_only = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for TuneQaScorecardRevision {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::deploy_qa_scorecard_revision][crate::client::ContactCenterInsights::deploy_qa_scorecard_revision] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeployQaScorecardRevision;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeployQaScorecardRevision {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeployQaScorecardRevision(
        RequestBuilder<crate::model::DeployQaScorecardRevisionRequest>,
    );

    impl DeployQaScorecardRevision {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeployQaScorecardRevisionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaScorecardRevision> {
            (*self.0.stub)
                .deploy_qa_scorecard_revision(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeployQaScorecardRevisionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeployQaScorecardRevision {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::undeploy_qa_scorecard_revision][crate::client::ContactCenterInsights::undeploy_qa_scorecard_revision] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UndeployQaScorecardRevision;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UndeployQaScorecardRevision {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UndeployQaScorecardRevision(
        RequestBuilder<crate::model::UndeployQaScorecardRevisionRequest>,
    );

    impl UndeployQaScorecardRevision {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UndeployQaScorecardRevisionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QaScorecardRevision> {
            (*self.0.stub)
                .undeploy_qa_scorecard_revision(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::UndeployQaScorecardRevisionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UndeployQaScorecardRevision {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_qa_scorecard_revision][crate::client::ContactCenterInsights::delete_qa_scorecard_revision] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteQaScorecardRevision;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteQaScorecardRevision {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteQaScorecardRevision(
        RequestBuilder<crate::model::DeleteQaScorecardRevisionRequest>,
    );

    impl DeleteQaScorecardRevision {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteQaScorecardRevisionRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_qa_scorecard_revision(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteQaScorecardRevisionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [force][crate::model::DeleteQaScorecardRevisionRequest::force].
        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.force = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteQaScorecardRevision {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_qa_scorecard_revisions][crate::client::ContactCenterInsights::list_qa_scorecard_revisions] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListQaScorecardRevisions;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListQaScorecardRevisions {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListQaScorecardRevisions(
        RequestBuilder<crate::model::ListQaScorecardRevisionsRequest>,
    );

    impl ListQaScorecardRevisions {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListQaScorecardRevisionsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListQaScorecardRevisionsResponse> {
            (*self.0.stub)
                .list_qa_scorecard_revisions(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<
            crate::model::ListQaScorecardRevisionsResponse,
            gax::error::Error,
        > {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::ListQaScorecardRevisionsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListQaScorecardRevisionsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListQaScorecardRevisionsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListQaScorecardRevisionsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ListQaScorecardRevisionsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListQaScorecardRevisions {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::create_feedback_label][crate::client::ContactCenterInsights::create_feedback_label] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CreateFeedbackLabel;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateFeedbackLabel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateFeedbackLabel(RequestBuilder<crate::model::CreateFeedbackLabelRequest>);

    impl CreateFeedbackLabel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateFeedbackLabelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::FeedbackLabel> {
            (*self.0.stub)
                .create_feedback_label(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateFeedbackLabelRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [feedback_label_id][crate::model::CreateFeedbackLabelRequest::feedback_label_id].
        pub fn set_feedback_label_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.feedback_label_id = v.into();
            self
        }

        /// Sets the value of [feedback_label][crate::model::CreateFeedbackLabelRequest::feedback_label].
        ///
        /// This is a **required** field for requests.
        pub fn set_feedback_label<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::FeedbackLabel>,
        {
            self.0.request.feedback_label = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [feedback_label][crate::model::CreateFeedbackLabelRequest::feedback_label].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_feedback_label<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::FeedbackLabel>,
        {
            self.0.request.feedback_label = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateFeedbackLabel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_feedback_labels][crate::client::ContactCenterInsights::list_feedback_labels] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListFeedbackLabels;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListFeedbackLabels {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListFeedbackLabels(RequestBuilder<crate::model::ListFeedbackLabelsRequest>);

    impl ListFeedbackLabels {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListFeedbackLabelsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListFeedbackLabelsResponse> {
            (*self.0.stub)
                .list_feedback_labels(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListFeedbackLabelsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::ListFeedbackLabelsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListFeedbackLabelsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ListFeedbackLabelsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListFeedbackLabelsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListFeedbackLabelsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListFeedbackLabels {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_feedback_label][crate::client::ContactCenterInsights::get_feedback_label] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetFeedbackLabel;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetFeedbackLabel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetFeedbackLabel(RequestBuilder<crate::model::GetFeedbackLabelRequest>);

    impl GetFeedbackLabel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetFeedbackLabelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::FeedbackLabel> {
            (*self.0.stub)
                .get_feedback_label(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetFeedbackLabelRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetFeedbackLabel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::update_feedback_label][crate::client::ContactCenterInsights::update_feedback_label] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::UpdateFeedbackLabel;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateFeedbackLabel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateFeedbackLabel(RequestBuilder<crate::model::UpdateFeedbackLabelRequest>);

    impl UpdateFeedbackLabel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateFeedbackLabelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::FeedbackLabel> {
            (*self.0.stub)
                .update_feedback_label(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [feedback_label][crate::model::UpdateFeedbackLabelRequest::feedback_label].
        ///
        /// This is a **required** field for requests.
        pub fn set_feedback_label<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::FeedbackLabel>,
        {
            self.0.request.feedback_label = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [feedback_label][crate::model::UpdateFeedbackLabelRequest::feedback_label].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_feedback_label<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::FeedbackLabel>,
        {
            self.0.request.feedback_label = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateFeedbackLabelRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateFeedbackLabelRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateFeedbackLabel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::delete_feedback_label][crate::client::ContactCenterInsights::delete_feedback_label] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::DeleteFeedbackLabel;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteFeedbackLabel {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteFeedbackLabel(RequestBuilder<crate::model::DeleteFeedbackLabelRequest>);

    impl DeleteFeedbackLabel {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteFeedbackLabelRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_feedback_label(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteFeedbackLabelRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteFeedbackLabel {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_all_feedback_labels][crate::client::ContactCenterInsights::list_all_feedback_labels] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListAllFeedbackLabels;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListAllFeedbackLabels {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListAllFeedbackLabels(RequestBuilder<crate::model::ListAllFeedbackLabelsRequest>);

    impl ListAllFeedbackLabels {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListAllFeedbackLabelsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListAllFeedbackLabelsResponse> {
            (*self.0.stub)
                .list_all_feedback_labels(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListAllFeedbackLabelsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::ListAllFeedbackLabelsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListAllFeedbackLabelsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListAllFeedbackLabelsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListAllFeedbackLabelsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ListAllFeedbackLabelsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListAllFeedbackLabels {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::bulk_upload_feedback_labels][crate::client::ContactCenterInsights::bulk_upload_feedback_labels] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::BulkUploadFeedbackLabels;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> BulkUploadFeedbackLabels {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct BulkUploadFeedbackLabels(
        RequestBuilder<crate::model::BulkUploadFeedbackLabelsRequest>,
    );

    impl BulkUploadFeedbackLabels {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::BulkUploadFeedbackLabelsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [bulk_upload_feedback_labels][crate::client::ContactCenterInsights::bulk_upload_feedback_labels].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .bulk_upload_feedback_labels(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `bulk_upload_feedback_labels`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::BulkUploadFeedbackLabelsResponse,
            crate::model::BulkUploadFeedbackLabelsMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::BulkUploadFeedbackLabelsResponse,
                crate::model::BulkUploadFeedbackLabelsMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::BulkUploadFeedbackLabelsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [validate_only][crate::model::BulkUploadFeedbackLabelsRequest::validate_only].
        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.validate_only = v.into();
            self
        }

        /// Sets the value of [source][crate::model::BulkUploadFeedbackLabelsRequest::source].
        ///
        /// Note that all the setters affecting `source` are
        /// mutually exclusive.
        pub fn set_source<
            T: Into<Option<crate::model::bulk_upload_feedback_labels_request::Source>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.source = v.into();
            self
        }

        /// Sets the value of [source][crate::model::BulkUploadFeedbackLabelsRequest::source]
        /// to hold a `GcsSource`.
        ///
        /// Note that all the setters affecting `source` are
        /// mutually exclusive.
        pub fn set_gcs_source<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::bulk_upload_feedback_labels_request::GcsSource>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_gcs_source(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for BulkUploadFeedbackLabels {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::bulk_download_feedback_labels][crate::client::ContactCenterInsights::bulk_download_feedback_labels] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::BulkDownloadFeedbackLabels;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> BulkDownloadFeedbackLabels {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct BulkDownloadFeedbackLabels(
        RequestBuilder<crate::model::BulkDownloadFeedbackLabelsRequest>,
    );

    impl BulkDownloadFeedbackLabels {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::BulkDownloadFeedbackLabelsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [bulk_download_feedback_labels][crate::client::ContactCenterInsights::bulk_download_feedback_labels].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .bulk_download_feedback_labels(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `bulk_download_feedback_labels`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::BulkDownloadFeedbackLabelsResponse,
            crate::model::BulkDownloadFeedbackLabelsMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::BulkDownloadFeedbackLabelsResponse,
                crate::model::BulkDownloadFeedbackLabelsMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::BulkDownloadFeedbackLabelsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::BulkDownloadFeedbackLabelsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [max_download_count][crate::model::BulkDownloadFeedbackLabelsRequest::max_download_count].
        pub fn set_max_download_count<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.max_download_count = v.into();
            self
        }

        /// Sets the value of [feedback_label_type][crate::model::BulkDownloadFeedbackLabelsRequest::feedback_label_type].
        pub fn set_feedback_label_type<
            T: Into<crate::model::bulk_download_feedback_labels_request::FeedbackLabelType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.feedback_label_type = v.into();
            self
        }

        /// Sets the value of [conversation_filter][crate::model::BulkDownloadFeedbackLabelsRequest::conversation_filter].
        pub fn set_conversation_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.conversation_filter = v.into();
            self
        }

        /// Sets the value of [template_qa_scorecard_id][crate::model::BulkDownloadFeedbackLabelsRequest::template_qa_scorecard_id].
        pub fn set_template_qa_scorecard_id<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.template_qa_scorecard_id = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [destination][crate::model::BulkDownloadFeedbackLabelsRequest::destination].
        ///
        /// Note that all the setters affecting `destination` are
        /// mutually exclusive.
        pub fn set_destination<
            T: Into<Option<crate::model::bulk_download_feedback_labels_request::Destination>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.destination = v.into();
            self
        }

        /// Sets the value of [destination][crate::model::BulkDownloadFeedbackLabelsRequest::destination]
        /// to hold a `GcsDestination`.
        ///
        /// Note that all the setters affecting `destination` are
        /// mutually exclusive.
        pub fn set_gcs_destination<
            T: std::convert::Into<
                    std::boxed::Box<
                        crate::model::bulk_download_feedback_labels_request::GcsDestination,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_gcs_destination(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for BulkDownloadFeedbackLabels {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::list_operations][crate::client::ContactCenterInsights::list_operations] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::ListOperations;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListOperations {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);

    impl ListOperations {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
            (*self.0.stub)
                .list_operations(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            longrunning::model::ListOperationsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.return_partial_success = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListOperations {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::get_operation][crate::client::ContactCenterInsights::get_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::GetOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);

    impl GetOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .get_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ContactCenterInsights::cancel_operation][crate::client::ContactCenterInsights::cancel_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_contactcenterinsights_v1::builder;
    /// use builder::contact_center_insights::CancelOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CancelOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);

    impl CancelOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ContactCenterInsights>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .cancel_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CancelOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
